Node 您所在的位置:网站首页 node java Node

Node

2023-09-13 21:59| 来源: 网络整理| 查看: 265

Node接口是整个文档对象模型的主要数据类型。 它表示文档树中的单个节点。 虽然实现Node接口的所有对象都公开了处理子Node方法,但并非所有实现Node接口的对象都可能有子Node 。 例如, Text节点可能没有子节点,并且向这些节点添加子节点会导致DOMException被引发。

字段nodeName , nodeValue和attributes包括作为一种机制来获取节点信息,而无需拆毁到特定的派生接口。 如果没有针对特定nodeType的这些属性的明显映射(例如,对于nodeValue为Element或对于attributes为Comment ),则返回null 。 请注意,专用接口可能包含其他更方便的机制来获取和设置相关信息。

的值nodeName , nodeValue ,和attributes根据不同节点类型,如下所示:

Interface table Interface nodeName nodeValue attributes Attr same as Attr.name same as Attr.value null CDATASection "#cdata-section" same as CharacterData.data, the content of the CDATA Section null Comment "#comment" same as CharacterData.data, the content of the comment null Document "#document" null null DocumentFragment "#document-fragment" null null DocumentType same as DocumentType.name null null Element same as Element.tagName null NamedNodeMap Entity entity name null null EntityReference name of entity referenced null null Notation notation name null null ProcessingInstruction same as ProcessingInstruction.target same as ProcessingInstruction.data null Text "#text" same as CharacterData.data, the content of the text node null

另见Document Object Model (DOM) Level 3 Core Specification 。



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有